package com.ocean.config;

import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import java.util.function.Supplier;

/**
 * 物品组注册
 *
 * @author zhang
 * @since 2021/11/5
 */
public class GroupConfig extends ItemGroup {

    private final Supplier<ItemStack> supplier;

    public GroupConfig(String name, Supplier<ItemStack> supplier) {
        super(name);
        this.supplier = supplier;
    }

    @Nonnull
    @Override
    public ItemStack makeIcon() {
        return supplier.get();
    }
}
